<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport" />
    <meta content="telephone=no" name="format-detection" />
    <title>登录</title>
    <link href="{{ static('css/main.css') }}" rel="stylesheet" type="text/css">
    <link href="{{ static('css/style.css') }}" rel="stylesheet" type="text/css">
    <link href="{{ static('css/shake.css') }}" rel="stylesheet" type="text/css">
    <link href="{{ static('css/font-awesome.min.css') }}" rel="stylesheet" type="text/css">
    <link href="{{ static('css/animate.min.css') }}" rel="stylesheet" type="text/css">
    <link href="{{ static('css/idangerous.swiper.css') }}" rel="stylesheet" type="text/css">
    <script type="text/javascript" src="{{ static('js/jquery-1.8.3.min.js') }}"></script>
    <script type="text/javascript" src="{{ static('js/wo.js') }}"></script>
</head>
<body style="background-color: #fff !important;">
<div class="warpe" id="app">
    <div class="head">
        <a href="#" class="return"><i class="icon-chevron-left"></i> 返回</a>
        注册
    </div>
    <div class="main">
        <div class="regall">
            <div class="reginput">
                <input type="text" placeholder="手机号" id="id_mobile">
            </div>
            <div class="reginput">
                <input type="text" placeholder="密码" id="id_password">
            </div>
            <div class="id_bth inersest_bth animated bounceIn" style="margin-top: 2rem;">
                <a href="#" id="login">登 录</a>
            </div>
            <div class="regTxt">
                <p><a href="register.html" class="puff_left">注册账号</a> <a href="{{ url('index:password') }}" class="puff_right">忘记密码</a></p>
            </div>
        </div>
    </div>
</div>
<script type="text/javascript">

    $('#login').click(function () {
        var username = document.getElementById("id_mobile").value;
        var password = document.getElementById("id_password").value;
        $.ajax({
            url : '/login/',
            data : {
                'username' : username,
                'password' : password,
            },
            type : 'post',
            {#dataType:"json",#}
            success: function (data) {
                if (data.errno == '0') {
                    // 登录成功跳转到首页
                    alert(data.errmsg);
                    window.location.href = '/';
                } else {
                    alert(data.errmsg)
                }
            }
        })

    });


</script>


</body>
</html>